import 'package:flutter_cwhisky/generated/json/base/json_field.dart';
import 'package:flutter_cwhisky/generated/json/good_entity.g.dart';
import 'dart:convert';

@JsonSerializable()
class GoodEntity {
	int? goodsId;
	String? goodsCode;
	String? image;
	String? cnName;
	String? enName;
	int promotionType =0;
	double marketPrice = 0;
	dynamic series;
	String? placeOfOrigin;
	int salesCount=0;
	int minOrderQuantity=0;
	int usableIntegral=0;
	List<dynamic>? salesFlag;
	int balanceCount=0;
	double price=0.0;
	double promotionPrice=0.0;
	double showPrice=0.0;
	int showPriceType =0;
	int cartItemCount =0;
	List<GoodAttrValueList>? attrValueList;
	String? brandEnName;
	String? brandCode;

	GoodEntity();

	factory GoodEntity.fromJson(Map<String, dynamic> json) => $GoodEntityFromJson(json);

	Map<String, dynamic> toJson() => $GoodEntityToJson(this);

	@override
	String toString() {
		return jsonEncode(this);
	}
}

@JsonSerializable()
class GoodAttrValueList {
	String? cnName;
	String? attributeValue;

	GoodAttrValueList();

	factory GoodAttrValueList.fromJson(Map<String, dynamic> json) => $GoodAttrValueListFromJson(json);

	Map<String, dynamic> toJson() => $GoodAttrValueListToJson(this);

	@override
	String toString() {
		return jsonEncode(this);
	}
}